package com.s3.s3demo.minio;

import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3.S3Client;

import java.net.URI;

public class MinioAuth {

    private static final String accessKeyId = "1Z0bTlO8LqwW7VMYkzUD";
    private static final String secretAccessKey = "MXyDlimY5qSA1ZlKmfpggsO2l16wq3FjyfQyEPHd";

    public static S3Client generateS3Client() {
        return S3Client.builder().endpointOverride(URI.create("http://172.20.150.34:31162"))
                .region(Region.CN_NORTH_1)
                .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(accessKeyId, secretAccessKey)))
                .build();
    }
}
